package com.huatai.user.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @program: ht-system
 * @description: user视图类
 * @author: songxiude
 * @create: 2023-02-06 10:50
 **/
@Data
@TableName("sys_user")
@ApiModel(value = "User实体", description = "用户实体类")
public class UserVo implements Serializable {
	@ApiModelProperty("主键id")
	@TableId
	private Long id;

	@ApiModelProperty("用户编号")
	//@NotNull(message = "code不能为空")
	@TableField("code")
	private String code;

	@ApiModelProperty(value = "用户账号",required = true)
	@NotBlank(message = "用户账号不能为空")
	@TableField("account")
	private String account;

	@ApiModelProperty("用户密码")
	@NotBlank(message = "用户密码不能为空")
	@TableField("password")
	private String password;

	@ApiModelProperty("用户昵称")
	@TableField("name")
	private String name;

	@ApiModelProperty("用户真实名称")
	@TableField("real_name")
	private String realName;

	@ApiModelProperty("用户头像")
	@TableField("avatar")
	private String avatar;

	@ApiModelProperty("邮箱")
	@TableField("email")
	@Email(message = "邮箱格式不正确")
	private String email;

	@ApiModelProperty("电话号码")
	@TableField("phone")
	private String phone;

	@ApiModelProperty("用户生日")
	@TableField("birthday")
	@JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8")
	private LocalDate birthday;

	@ApiModelProperty("性别0未知1男2女")
	@TableField("sex")
	private Integer sex;

	@ApiModelProperty("是否管理员0否1是")
	@TableField("is_admin")
	private Integer isAdmin;

	@ApiModelProperty("部门id")
	@TableField("dept_id")
	private Long deptId;

	@ApiModelProperty("岗位id")
	@TableField("post_id")
	private Long postId;

	@ApiModelProperty("用户皮肤1深色2浅色")
	@TableField("skin")
	private Integer skin;

	@ApiModelProperty("创建人用户id")
	@TableField("create_userid")
	private Long createUserid;

	@ApiModelProperty("创建时间")
	@TableField("create_time")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
	private LocalDateTime createTime;

	@ApiModelProperty("更新人用户id")
	@TableField("update_userid")
	private Long updateUserid;

	@ApiModelProperty("更新时间")
	@TableField("update_time")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone="GMT+8")
	private LocalDateTime updateTime;

	@ApiModelProperty("状态0整除1禁用")
	@TableField("status")
	private Integer status;

	@ApiModelProperty("权限列表")
	private List<String> permissions;
}
